package net.gxf.excel;


import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import net.gxf.common.etf.ETFTool;



/**
 * 
 * @author: maybe
 * 
 */
public class FindETFUI extends JFrame {

	private static final long serialVersionUID = 1L;
	JProgressBar progressBar = new JProgressBar(SwingConstants.HORIZONTAL);

	public FindETFUI() {
		this.setSize(500, 60);
		this.setLocationRelativeTo(null);
		this.setTitle("Debug");
		//this.setUndecorated(true);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setVisible(true);
	}

	private void run() {
		progressBar.setValue(0);
		progressBar.setStringPainted(true);
		progressBar.setString("正在生成数据，请稍等....");
		progressBar.setIndeterminate(true);
		//this.add(progressBar,BorderLayout.NORTH);
		this.add(progressBar);
		
		ETFTool ettfTool = new ETFTool();
	   // ettfTool.saveETFAsTXT();
		ettfTool.saveETFAsExcel();
		
       progressBar.setVisible(false);
       JOptionPane.showMessageDialog(this, "数据导出位置：C:/ETF/DATA","完成",JOptionPane.INFORMATION_MESSAGE);
       this.dispose();
		
	}
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		FindETFUI mainUI = new FindETFUI();
		mainUI.run();
	}

}
